<template>

    <div>
        <!--<x-header></x-header>-->
        <group>
            <!--<cell :title="$t('My Account')" :value="$t('Protected')" @click.native="onClick"></cell>
            <cell :title="$t('Money')" @click.native="onClick" :is-loading="!money" :value="money"></cell>
            <cell :title="$t('Withdraw')" disabled is-link></cell>-->
            <div style="position:relative;left:80px">
                <x-img style="width:100px;height:100px;" :src="user.userinfo.head"></x-img>
                <span style="position:relative;top:-25px">{{user.userinfo.nick}}</span>
            </div>
        </group>
        <group style="position:absolute; width:100%;height:55%;overflow:scroll">
            <div v-for="prize in prizeArr" >
                <cell :title="prize.mch_name + '[' + prize.lottery_code + ']'">奖品:{{prize.prize}}<x-button v-if="!prize.isget" mini type="warn">未兑</x-button></cell>
            </div>
        </group>
    </div>

</template>

<script>
    import { XHeader,Group,Cell,XImg,XButton } from 'vux'
    import user from '../../api/user.js'
    export default {
        components: {
            XButton,
            XHeader,
            Group,
            Cell,
            XImg
        },
        data() {
            return {
                user,
                prizeArr:[]
            }
        },
        mounted() {
            // opxwxw-GdJvK9Xf9wZxzRP4Jw0vU
            // this.$axios.get('/lottery/getPrize?openid='+user.userinfo.openid)
            this.$axios.get('/lottery/getPrize?openid='+user.userinfo.openid)
            .then((ret)=>{
                this.prizeArr = ret.data
            })
        },
        methods: {
            
        }
    };
</script>

<style lang="less" scoped>
    input{
        border: 1px solid black
    }
    .day {
        background-color:#000;
        color:#fff;
        text-align:center;
        display:inline-block;
        padding:0 3px;
        border-radius:3px;
    }
</style>